package cn.hk.orderqueryu.controller;

import cn.HK.po.Order;
import cn.HK.po.User;

import cn.hk.orderqueryu.service.QueryUserService;
import cn.hk.orderqueryu.user.UserView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.resource.HttpResource;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/order")
public class QueryUserController {
    @Autowired
    private QueryUserService queryUserService;
    /*
     * 查询用户所有订单
     * 请求地址：/order/queryu/{uId}
     * */
    @RequestMapping(value = "/queryu/{uId}",method = RequestMethod.POST)
    public List<UserView> queryUserOrders(@PathVariable("uId") String uId){
        return  queryUserService.queryUserOrders(uId);
    }


}
